package com.ruoyi.system.service.account;

import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.system.domain.bean.account.param.IncreaseDecreaseMargin;
import com.ruoyi.system.domain.bean.account.param.SetLeverage;
import com.ruoyi.system.domain.bean.account.param.SetPositionMode;
import com.ruoyi.system.domain.bean.account.param.SetTheDisplayTypeOfGreeks;

/**
 * 
 * @author spb512
 * @date 2022年6月5日 下午5:02:59
 *
 */
public interface AccountApiService {

	/**
	 * 查看账户持仓风险 Get account and position risk
	 * 
	 * @param instType
	 * @return
	 */
	JSONObject getAccountAndPosition(String instType);

	/**
	 * 查看账户余额 Get Balance
	 * 
	 * @param ccy
	 * @return
	 */
	JSONObject getBalance(String ccy);

	/**
	 * 查看持仓信息 Get Positions
	 * 
	 * @param instType
	 * @param instId
	 * @param posId
	 * @return
	 */
	JSONObject getPositions(String instType, String instId, String posId);

	/**
	 * 账单流水查询（近七天） Get Bills Details (last 7 days)
	 * 
	 * @param instType
	 * @param ccy
	 * @param mgnMode
	 * @param ctType
	 * @param type
	 * @param subType
	 * @param after
	 * @param before
	 * @param limit
	 * @return
	 */
	JSONObject getBillsDetails7Days(String instType, String ccy, String mgnMode, String ctType, String type,
			String subType, String after, String before, String limit);

	/**
	 * 账单流水查询（近七天） Get Bills Details (last 3 months)
	 * 
	 * @param instType
	 * @param ccy
	 * @param mgnMode
	 * @param ctType
	 * @param type
	 * @param subType
	 * @param after
	 * @param before
	 * @param limit
	 * @return
	 */
	JSONObject getBillsDetails3Months(String instType, String ccy, String mgnMode, String ctType, String type,
			String subType, String after, String before, String limit);

	/**
	 * 查看账户配置 Get Account Configuration
	 * 
	 * @return
	 */
	JSONObject getAccountConfiguration();

	/**
	 * 设置持仓模式 Set Position mode
	 * 
	 * @param setPositionMode
	 * @return
	 */
	JSONObject setPositionMode(SetPositionMode setPositionMode);

	/**
	 * 设置杠杆倍数 Set Leverage
	 * 
	 * @param setLeverage
	 * @return
	 */
	JSONObject setLeverage(SetLeverage setLeverage);

	/**
	 * 获取最大可买卖/开仓数量 Get maximum buy/sell amount or open amount
	 * 
	 * @param instId
	 * @param tdMode
	 * @param ccy
	 * @param px
	 * @return
	 */
	JSONObject getMaximumTradableSizeForInstrument(String instId, String tdMode, String ccy, String px);

	/**
	 * 获取最大可用数量 Get Maximum Tradable Size For Instrument
	 * 
	 * @param instId
	 * @param tdMode
	 * @param ccy
	 * @param reduceOnly
	 * @return
	 */
	JSONObject getMaximumAvailableTradableAmount(String instId, String tdMode, String ccy, String reduceOnly);

	/**
	 * 调整保证金 Increase/Decrease margin
	 * 
	 * @param increaseDecreaseMargin
	 * @return
	 */
	JSONObject increaseDecreaseMargin(IncreaseDecreaseMargin increaseDecreaseMargin);

	/**
	 * 获取杠杆倍数 Get Leverage
	 * 
	 * @param instId
	 * @param mgnMode
	 * @return
	 */
	JSONObject getLeverage(String instId, String mgnMode);

	/**
	 * 获取交易产品最大可借 Get the maximum loan of instrument
	 * 
	 * @param instId
	 * @param mgnMode
	 * @param mgnCcy
	 * @return
	 */
	JSONObject getTheMaximumLoanOfIsolatedMargin(String instId, String mgnMode, String mgnCcy);

	/**
	 * 获取当前账户交易手续费费率 Get Fee Rates
	 * 
	 * @param instType
	 * @param instId
	 * @param uly
	 * @param category
	 * @return
	 */
	JSONObject getFeeRates(String instType, String instId, String uly, String category);

	/**
	 * 获取计息记录 Get interest-accrued
	 * 
	 * @param instId
	 * @param ccy
	 * @param mgnMode
	 * @param after
	 * @param before
	 * @param limit
	 * @return
	 */
	JSONObject getInterestAccrued(String instId, String ccy, String mgnMode, String after, String before, String limit);

	/**
	 * 获取用户当前杠杆借币利率 Get interest rate
	 * 
	 * @param ccy
	 * @return
	 */
	JSONObject getInterestRate(String ccy);

	/**
	 * 期权希腊字母PA/BS切换 Set the display type of Greeks
	 * 
	 * @param setTheDisplayTypeOfGreeks
	 * @return
	 */
	JSONObject setTheDisplayTypeOfGreeks(SetTheDisplayTypeOfGreeks setTheDisplayTypeOfGreeks);

	/**
	 * 查看账户最大可转余额 Get Maximum Withdrawals
	 * 
	 * @param ccy
	 * @return
	 */
	JSONObject getMaximumWithdrawals(String ccy);
}
